import { _store } from './state.js';

export function addCart({ id, name, price }) {
  if (!_store.cartList[id]) {
    _store.cartList[id] = {
      num: 0,
      name,
      price,
    };
  }

  _store.cartList[id].num++;

  wx.showToast({
    title: '添加成功',
    duration: 1200,
    icon: 'none',
  });
}
